package com.woniu.HisHospitalizationApi;

import com.woniu.dto.HisConsumptionDto;
import com.woniu.dto.PageDTO;
import com.woniu.param.HisConsumptionAddParam;
import com.woniu.param.HisConsumptionParam;
import com.woniu.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@FeignClient(
        value = "his-hospitalization",
        contextId = "HisConsumption")
@Api(tags = "住院消费记录接口")
public interface HisConsumptionApi {
    //根据id查询所有消费记录
    @ApiOperation("查询消费记录")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "id",
//                    value = "查询参数",
//                    required = false,
//                    dataType = "arraylist")
//    })
    @PostMapping("getHisConsumptionBy")
    public Result<PageDTO<HisConsumptionDto>> getHisConsumptionBy(@RequestBody HisConsumptionParam hisConsumptionParam);

    //根据id删除消费记录
    @ApiOperation("根据id删除消费记录")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "id",
//                    value = "查询参数",
//                    required = false,
//                    dataType = "ArrayList<Integer>" )
//    })
    @DeleteMapping("deletegetHisConsumptionById")
    public Result<Boolean> deletegetHisConsumptionById(@RequestParam("id") ArrayList<Integer> id);

    //修改消费记录
    @ApiOperation("修改消费记录")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "hisConsumptionParam",
//                    value = "消费记录对象",
//                    required = false,
//                    dataType = "hisConsumptionParam")
//    })
    @PutMapping("updateHisConsumption")
    public Result<HisConsumptionDto> updateHisConsumption(@RequestBody HisConsumptionParam hisConsumptionParam);

    //新增消费记录
    @ApiOperation("新增消费记录")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "hisConsumptionParam",
//                    value = "消费记录对象",
//                    required = false,
//                    dataType = "hisConsumptionParam")
//    })
    @PostMapping("addHisConsumption")
    public Result<HisConsumptionDto> addHisConsumption(@RequestBody HisConsumptionAddParam hisConsumptionAddParam);

}
